Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add len field to vectors #3941

Closed
wants to merge 1 commit into from
Closed

Add len field to vectors #3941

wants to merge 1 commit into from

Conversation

data-man
Copy link
Contributor

Extracted from awesome #2945.

@daurnimator daurnimator added stage1 The process of building from source via WebAssembly and the C backend. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. labels Dec 19, 2019
expect(q.len == 4);
const v = @Vector(4, i32);
expect(v.len == 4);
expect(v.bit_count == 32);
Copy link
Contributor Author

@data-man data-man Dec 19, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be v.bit_count == v[0].bit_count * v.len?

@data-man data-man mentioned this pull request Dec 19, 2019
@data-man
Copy link
Contributor Author

@andrewrk
Please take a look.

@andrewrk
Copy link
Member

This will not work because vectors of pointers to structs are supported, and len of the vector would conflict with a len field of a struct.

@data-man
Copy link
Contributor Author

I didn't find any tests for vectors of pointers. :(

@data-man
Copy link
Contributor Author

I don't know (yet) how to fix it, so feel free to close.

@andrewrk
Copy link
Member

Yeah it's a tough problem. Sorry for the lack of organized docs that led to you spending time on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. stage1 The process of building from source via WebAssembly and the C backend.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants